home *** CD-ROM | disk | FTP | other *** search
-
-
-
- iiiillllRRRRooooiiiiIIIItttteeeerrrr((((3333)))) IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll iiiillllRRRRooooiiiiIIIItttteeeerrrr((((3333))))
-
-
-
- NNNNAAAAMMMMEEEE
- iiiillllRRRRooooiiiiIIIItttteeeerrrr - class for cycling through run lengths in an ROI
-
- IIIINNNNHHHHEEEERRRRIIIITTTTSSSS FFFFRRRROOOOMMMM
- This is a base class and therefore has no inheritance.
-
- HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
- #include <il/ilRoiIter.h>
-
- CCCCLLLLAAAASSSSSSSS DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- This abstract class provides functions that can be used to iterate or
- cycle through a region-of-interest, or ROI. They can be used within a
- specified rectangle (clip box) or an entire image. Once an ROI has been
- created (see the ilRectRoi and ilImgRoi man pages), an iterator can be
- constructed that binds the ROI to an image at a specified offset.
-
- An ilRoiIter object provides functions to cycle through runs of valid
- and/or invalid data: nnnneeeexxxxtttt() and nnnneeeexxxxttttMMMMaaaattttcccchhhh(). Functions are provided
- that return the starting location and lengths of the run lengths:
- ggggeeeettttXXXX(), ggggeeeettttYYYY(), ggggeeeettttZZZZ() and ggggeeeettttLLLLeeeennnn().
-
- Once an ilRoiIter object has been created, it may be used to step through
- the valid and/or invalid regions defined by the ROI.
-
- EEEExxxxaaaammmmpppplllleeee ooooffff uuuusssseeee
-
- The following example demonstrates how to use an ROI iterator:
-
- //create a rectangular ROI of size 50 x 60
- ilRectRoi myroi(50, 60, 1);
-
- //set ROI attributes
-
- ilImage *img = ilOpenImgFile ("myImage", "r");
-
- // create an iterator, mapping the ROI to the image at offset (10,20)
- ilRoiIter* iter;
- iflXYZint off(10, 20, 0);
- myroi.createIter(NULL, &iter, img, 0, 0, 0, 100, 100, 1, &off);
-
- // for each valid region...
- while (iter->nextMatch()) {
- int xbegin = iter->getX();
- int ybegin = iter->getY();
- int len = iter->getLen();
-
- // do some processing
-
- }
-
- DDDDeeeerrrriiiivvvviiiinnnngggg ffffrrrroooommmm iiiillllRRRRooooiiiiIIIItttteeeerrrr
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- iiiillllRRRRooooiiiiIIIItttteeeerrrr((((3333)))) IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll iiiillllRRRRooooiiiiIIIItttteeeerrrr((((3333))))
-
-
-
- Each derived class of ilRoi requires a derived ilRoiIter class that
- iterates over the run-lengths of the ROI. Deriving a new class requires
- only that the pure virtual nnnneeeexxxxtttt() be defined to advance to the next
- segment of the ROI. An ROI segment is a length of pixels, consecutive in
- the X dimension, that lies entirely inside or entirely outside the valid
- region. The iterator should advance in X first, then Y, and finally Z
- (for 3D ROI's). The protected method uuuuppppddddaaaatttteeee() performs some common
- post-processing that all iterators will need to do. A typical recipe for
- nnnneeeexxxxtttt() is:
-
- check if done; if so return FALSE;
- set _l_a_s_t = _p_o_s; (remember where this segment started)
- set _f_o_r_e flag based on first pixel in segment;
- (foreground/valid -> TRUE; background/invalid -> FALSE)
- scan pixels while foreground state remains the same;
- call uuuuppppddddaaaatttteeee();
- return TRUE;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- iiiillllRRRRooooiiiiIIIItttteeeerrrr((((3333)))) IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll iiiillllRRRRooooiiiiIIIItttteeeerrrr((((3333))))
-
-
-
- CCCCLLLLAAAASSSSSSSS MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN SSSSUUUUMMMMMMMMAAAARRRRYYYY
- CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrr
-
- ilRoiIter(ilRoi *roi, ilRoiMap *map) protected
-
-
- GGGGeeeetttt rrrruuuunnnn lllleeeennnnggggtttthhhhssss,,,, ssssttttaaaarrrrttttiiiinnnngggg llllooooccccaaaattttiiiioooonnnn
-
- int getX()
- int getY()
- int getLen()
-
-
- SSSStttteeeepppp ttttoooo nnnneeeexxxxtttt RRRROOOOIIII rrrreeeeggggiiiioooonnnn
-
- int next()
- int nextMatch(int foreground=TRUE)
-
-
- FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNSSSS
- iiiillllRRRRooooiiiiIIIItttteeeerrrr(((())))
-
- ilRoiIter(ilRoi *roi, ilImage* img)
-
-
- The constructor takes a pointer to an ROI object, _r_o_i, and a pointer
- to an ilImage object, _i_m_g. The constructor is protected, since it
- should only be called from derived class constructors.
-
- ggggeeeettttLLLLeeeennnn(((())))
-
- int getLen()
-
-
- Returns length of the current run of valid or invalid data.
- Typically, this function is called after nnnneeeexxxxtttt() or nnnneeeexxxxttttMMMMaaaattttcccchhhh() is
- called.
-
- ggggeeeettttXXXX(((())))
-
- int getX()
-
-
- Returns the x coordinate of the starting location of the run length.
- Typically, this function is called after nnnneeeexxxxtttt() or nnnneeeexxxxttttMMMMaaaattttcccchhhh() is
- called. This x coordinate is computed in the orientation specified
- in the target image.
-
- ggggeeeettttYYYY(((())))
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-
-
-
- iiiillllRRRRooooiiiiIIIItttteeeerrrr((((3333)))) IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll iiiillllRRRRooooiiiiIIIItttteeeerrrr((((3333))))
-
-
-
- int getY()
-
-
- Returns the y coordinate of the starting location of the run length.
- Typically, this function is called after nnnneeeexxxxtttt() or nnnneeeexxxxttttMMMMaaaattttcccchhhh() is
- called. This y coordinate is computed in the orientation specified
- in the target image.
-
- ggggeeeettttZZZZ(((())))
-
- int getZ()
-
-
- Returns the z coordinate of the starting location of the run length.
- Typically, this function is called after nnnneeeexxxxtttt() or nnnneeeexxxxttttMMMMaaaattttcccchhhh() is
- called. The z coordinate is only useful when dealing with a 3-
- dimensional region of interest; in the 2-D case, it can be ignored.
-
- ggggeeeettttVVVVaaaalllluuuueeee(((())))
-
- float getValue()
-
-
- Returns the value of the region; this is currently only useful when
- using an image-mapped ROI (ilImgRoi) in "run-length" mode; see the
- man page for ilImgRoi for more details on run-length ROI processing.
-
- nnnneeeexxxxtttt(((())))
-
- int next()
-
-
- This function returns TRUE if a valid or invalid region is found;
- false if the iterator has completely scanned the specified area.
-
- nnnneeeexxxxttttMMMMaaaattttcccchhhh(((())))
-
- int nextMatch(int foreground=TRUE)
-
-
- This function returns TRUE if a region matching the specified type
- is found; false otherwise. If the _f_o_r_e_g_r_o_u_n_d paramater is TRUE,
- then only a foreground, or valid, region will be returned. If
- FALSE, then only a background, or invalid, region will be returned.
-
- IIIINNNNHHHHEEEERRRRIIIITTTTEEEEDDDD MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- ilImgRoi, ilRectRoi, ilRoi
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 4444
-
-
-
-